<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="s" uri="http://shiro.apache.org/tags" %>

<div class="table-div">
	<div class="table-operator">
		<button class="btn green formbtn-add">Create</button>
	</div>
	<div class="clearfix"></div>
	<div class="table-filter">&nbsp;</div>
	<div class="table-body">
		<table class="table table-striped table-hover table-bordered "></table>
	</div>
</div>

<script>
	var baseUrl = "rest/admin/user/";
	C.initAjax(baseUrl);
	var $table = $(".table-body>table");
	var tb = $table.DataTable({
				ajax : {
					url : baseUrl + "listData",
					dataSrc : ""
				},
				columns : [
					{
						title:"用户名",
						data:"username"
					},
					{
						title:"创建时间",
						data:"createTime",
						createdCell:function(td,tdData){
							$(td).html(new Date(tdData).format("yyyy-MM-dd hh:mm"));
						}
					}
					, {
						title : "操作",
						data : "id",
						createdCell:function(td,tdData){
							var delBtn;
							<s:hasPermission name="/admin/user/delete">
							delBtn=C.createDelBtn(tdData);
						    </s:hasPermission>
							var editBtn;
							<s:hasPermission name="/admin/user/edit">
								editBtn = C.createEditBtn(tdData);
							</s:hasPermission>
							var operator = [editBtn,delBtn];
							$(td).html(operator);
						}
					} ],
			});
	currentDt = tb;

	
	
</script>